<?php 
header("content-type:text/html;charset=utf8");
$pdo = new PDO("mysql:host=127.0.0.1;charset=utf8;dbname=liu",'root','root');
$data = $pdo->query("select * from hot_goods")->fetchall(PDO::FETCH_ASSOC);

$endtime = $data[0]['end_time'];
$endtime = strtotime($endtime);
$time = $endtime-time();
$hour = floor($time/3600);
$min = floor(($time-$hour*3600)/60);
$sec = $time-$hour*3600-$min*60;

echo json_encode(array('hour'=>$hour,'min'=>$min,'sec'=>$sec));












 ?>